package Controller.Commodit;

import Models.dao.CommoditDao;
import Models.enity.Commodit;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/transactional/orderRequest")
public class orderRequest extends HttpServlet {
    private static String PublicPath = "/WEB-INF/views";
    private CommoditDao commoditDao = new CommoditDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        List<Commodit> commodit = commoditDao.findAll();
        req.setAttribute("commodit",commodit);
        req.getRequestDispatcher(PublicPath + "/commodit/orderRequest.jsp").forward(req,resp);
    }
}
